package com.example.imtoken.room.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import com.example.imtoken.room.schema.WalletAddressSchema

@Dao
interface WalletAddressDao {

    @Insert
    fun insertWalletAddress(walletAddressSchema: WalletAddressSchema): Long

    @Query("SELECT * FROM wallet_address")
    fun getWalletAddress(): MutableList<WalletAddressSchema>?

    @Query("SELECT * FROM wallet_address WHERE fatherAddress = :fatherAddress")
    fun getAccountWalletAddress(fatherAddress: String?): MutableList<WalletAddressSchema>?

    @Delete
    fun deleteWalletAddress(walletAddressSchema: WalletAddressSchema): Int

    @Query("DELETE FROM wallet_address")
    fun delete(): Int
}